package com.example.rabbitmq.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicConsumer {

    //四个接受者 湖南，湖北，天气，新闻

    @RabbitListener(queues = "huNan.queue")
    public void huNna(String message){
        System.out.println("湖南接受消息：" + message);
    }

    @RabbitListener(queues = "huBei.queue")
    public void huBei(String message){
        System.out.println("湖北接受消息：" + message);
    }

    @RabbitListener(queues = "weather.queue")
    public void watter(String message){
        System.out.println("天气接受消息：" + message);
    }

    @RabbitListener(queues = "news.queue")
    public void news(String message){
        System.out.println("新闻接受消息：" + message);
    }
}
